package cn.liuhaihua.admin;

import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @author shang
 * @date 2019/1/5
 */
public class ServiceMain {

    public static void main(String[] args) {
        ServiceLoader<DubboService> spiLoader = ServiceLoader.load(DubboService.class);
        Iterator<DubboService> iteratorSpi = spiLoader.iterator();
        while (iteratorSpi.hasNext()) {
            DubboService dubboService = iteratorSpi.next();
            dubboService.sayHello();
        }
    }
}